package com.heima.article.xxl;

import com.heima.article.service.HotArticleService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ComputeHotArticle {
    @Autowired
    private HotArticleService hotArticleService;

    @XxlJob("liangzaiyeqi")
    public void computeHotArticle() {
        log.info("分布式定时器xxlJob开始执行计算热点文章任务。。。。");
        hotArticleService.computerHotArticle();
        log.info("计算热点文章任务完成。。。");
    }
}
